# $Id: PKGBUILD 88261 2013-04-15 11:10:36Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=ecb
pkgver=2.40.1pre
pkgrel=7
pkgdesc="Emacs Code Browser"
arch=('any')
url="http://ecb.sourceforge.net/"
depends=('emacs')
license=('GPL')
install=ecb.install
#source=(http://downloads.sourceforge.net/ecb/$pkgname-$pkgver.tar.gz)
#source=(ecb-$pkgver.tar.gz::http://ecb.sourceforge.net/cvs_snapshots/ecb.tar.gz)
source=(git://github.com/emacsmirror/ecb.git)
md5sums=('SKIP')

build() {
  cd $srcdir/$pkgname
  sed -i 's|common/cedet.el|cedet.elc|' Makefile
}

package() {
  cd $srcdir/$pkgname
  _emacsver=`pacman -Q emacs | cut -f2 -d\ |cut -f1 -d-`
  mkdir -p $pkgdir/usr/share/emacs/site-lisp/ecb
  make CEDET=/usr/share/emacs/${_emacsver}/lisp/cedet ecb
  cp -R $srcdir/$pkgname-snap/* $pkgdir/usr/share/emacs/site-lisp/ecb
  find $pkgdir/usr/share -type f -exec chmod 0644 {} \;
  find $pkgdir/usr/share -type d -exec chmod 0755 {} \;
}
